//
//  NEDFormItem.m
//  NEDFormView_Example
//
//  Created by 000 on 2022/1/7.
//  Copyright © 2022 000. All rights reserved.
//

#import "NEDFormItem.h"
#import "NEDFormItem+Privite.h"

@interface NEDFormItem()

/// 关联的section cell 上显示的数据
@property (retain, nonatomic, readwrite) NSMutableArray * rowDataList;

@end

@implementation NEDFormItem

-(instancetype)init{
    self = [super init];
    if(self){
        self.layout = [NEDFormSectionLayout new];
        self.isChangeAutoReloadView = YES;
        
        self.rowDataList = [NSMutableArray new];
    }
    return self;
}

- (BOOL)isAvailable{
    if(self.leftContent){
        if(!self.leftContent.isAvailable){
            return NO;
        }
    }
    if(self.rightContent){
        if(!self.rightContent.isAvailable){
            return NO;
        }
    }
    if(self.centerContent){
        if(!self.centerContent.isAvailable){
            return NO;
        }
    }
    return YES;
}

- (NSString *)headerReuseIdentifier{
    if(!self.registerReuseIdentifier && self.registerReuseIdentifier.length > 0){
        return self.registerReuseIdentifier;
    }
    return @(self.hash).stringValue;
}

@end

